package homework;

public class Account {
    public     int accNO;
    public     String  accName;
    public     String    accPassword;
    public     int  accTelno;
    public     double accBalance;

    public     int accType;

    public  double depoist(double mouney){

        accBalance+=mouney;
        System.out.println("存款" + mouney + "元,当前存款为" + accBalance + "元");
        return accBalance ;

    }
    public   double withdraw(double out) {
        accBalance = accBalance - out;
        System.out.println("取款" + out + "元,当前存款为" + accBalance + "元");
        return accBalance;
    }
    public Account(int accNO, String accName, String accPassword, int accTelno, double accBalance, int accType) {
        this.accNO = accNO;
        this.accName = accName;
        this.accPassword = accPassword;
        this.accTelno = accTelno;
        this.accBalance = accBalance;
        this.accType = accType;

    }

    public int getAccNO() {
        return accNO;
    }

    public void setAccNO(int accNO) {
        this.accNO = accNO;
    }

    public String getAccName() {
        return accName;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public String getAccPassword() {
        return accPassword;
    }

    public void setAccPassword(String accPassword) {
        this.accPassword = accPassword;
    }

    public int getAccTelno() {
        return accTelno;
    }

    public void setAccTelno(int accTelno) {
        this.accTelno = accTelno;
    }

    public double getAccBalance() {
        return accBalance;
    }

    public void setAccBalance(double accBalance) {
        this.accBalance = accBalance;
    }

    public int getAccType() {
        return accType;
    }

    public void setAccType(int accType) {
        this.accType = accType;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Account{");
        sb.append("accNO=").append(accNO);
        sb.append(", accName='").append(accName).append('\'');
        sb.append(", accPassword='").append(accPassword).append('\'');
        sb.append(", accTelno=").append(accTelno);
        sb.append(", accBalance=").append(accBalance);
        sb.append(", accType=").append(accType);
        sb.append('}');
        return sb.toString();
    }
}
